package com.entrogy.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @ClassName SimpleExamEntity
 * @Description 用于展示需要录入考试成绩的年级的实体类
 * @Author luoxingjiang
 * @Date 2019/6/5 0005 下午 5:48
 * @Version 1.0
 **/
@SuppressWarnings("serial")
@AllArgsConstructor
@NoArgsConstructor
@Data
@Accessors(chain = true)
public class SimpleExamEntity {

    private Integer examId;

    private String examName;

    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date examTime;

    // 考试人数
    private Integer totalCount;

    private List<ClassEntity> classList;

    private List<CourseEntity> courseList;

    @Override
    public boolean equals(Object obj) {
        SimpleExamEntity examEntity = (SimpleExamEntity)obj;
        return this.examId.equals(examEntity.getExamId());
    }

    @Override
    public int hashCode() {
        return this.examId.hashCode();
    }
}
